package com.kaili.basic.mapper;


import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.kaili.basic.pojo.dto.OutboundApplicationQueryDto;
import com.kaili.basic.pojo.dto.OutboundInventoryQueryDto;
import com.kaili.basic.pojo.entity.OutboundApplication;
import com.kaili.basic.pojo.entity.OutboundApplicationExport;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;


/**
 * Created by xxx on 18-4-25.
 */

@Mapper
public interface OutboundApplicationMapper {
    //添加出库申请
    int addOutboundApplication(OutboundApplication outboundApplication);

    //删除出库申请
    int deleteOutboundApplication(OutboundApplication outboundApplication);

    //删除出库申请
    int deleteOutboundApplications(Map<String, Object> map);

    //修改出库申请
    int updateOutboundApplication(OutboundApplication outboundApplication);

    //条件查询获取出库申请信息
    List<OutboundApplication> queryOutboundApplication(Pagination page, OutboundApplicationQueryDto outboundApplicationQueryDto);

    //id查询获取出库申请详细信息
    OutboundApplication queryOutboundApplicationById(Long applyId);

    //订单号查询获取出库申请详细信息
    OutboundApplication queryOutboundApplicationByNo(String requestCode);

    //查询当前数据库中的最大id
    Long getMaxApplyId();

    Long getMaxOutboundCount();

    //查询总数量与出库数量之间相差数
    Integer getDifferQuantity(Long applyId);

    //查询出库申请总退货数量
    Long getSumReturnQuantity(Long applyId);

    //出库时查询仓库可出库存
    Long queryWarehouseInventory(OutboundInventoryQueryDto outboundInventoryQueryDto);

    //导出
    List<OutboundApplicationExport> queryOutboundApplicationExport(OutboundApplicationQueryDto outboundApplicationQueryDto);
}
